# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-rst.linker
pkgver=2.4.0
pkgrel=1
pkgdesc="Tools for adding metadata and hyperlinks to reStructuredText"
url="https://github.com/jaraco/rst.linker"
arch="noarch"
license="MIT"
depends="py3-dateutil py3-sphinx"
makedepends="py3-gpep517 py3-installer py3-setuptools_scm py3-wheel"
checkdepends="py3-path py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/r/rst.linker/rst.linker-$pkgver.tar.gz"
builddir="$srcdir/rst.linker-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
31e3427ecf35b433cc9650138ee36090e99003b72c69b60b530835eb624d7eb13aae4cf81cc0044b36750798a4b8aa676e53e3b9eb335430076593640a243940  rst.linker-2.4.0.tar.gz
"
